import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "home",
    component: () => import("../views/HomeView.vue"),
  },
  {
    path: "/about",
    name: "about",
    component: () => import("../views/AboutView.vue"),
  },
  {
    path: "/about/introduction",
    name: "about-introduction",
    component: () => import("../views/AboutView_Introduction.vue"),
  },
  {
    path: "/about/value",
    name: "about-value",
    component: () => import("../views/AboutView_Value.vue"),
  },
  {
    path: "/about/member",
    name: "about-member",
    component: () => import("../views/AboutView_Member.vue"),
  },
  {
    path: "/business",
    name: "business",
    component: () => import("../views/BusinessView.vue"),
  },
  {
    path: "/business/platform",
    name: "business-platform",
    component: () => import("../views/BusinessView_Platform.vue"),
  },
  {
    path: "/business/selection",
    name: "business-selection",
    component: () => import("../views/BusinessView_Selection.vue"),
  },
  {
    path: "/business/selection/meatball",
    name: "business-selection-meatball",
    component: () => import("../views/BusinessView_Selection_Meatball.vue"),
  },
  {
    path: "/business/selection/noodle",
    name: "business-selection-noodle",
    component: () => import("../views/BusinessView_Selection_Noodle.vue"),
  },

  {
    path: "/business/selection/angus",
    name: "business-selection-angus",
    component: () => import("../views/BusinessView_Selection_Angus.vue"),
  },
  {
    path: "/news",
    name: "news",
    component: () => import("../views/NewsView.vue"),
  },
  {
    path: "/join",
    name: "join",
    component: () => import("../views/JoinView.vue"),
  },
  {
    path: "/contact",
    name: "contact",
    component: () => import("../views/ContactView.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { top: 0 };
    }
  },
});

export default router;
